package com.gscitysfy.cus.drain.modules.pipe.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.gscitysfy.cus.drain.modules.pipe.entity.DrainPipeNetworkPlan;
import com.gscitysfy.cus.drain.utils.DateUtil;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @author 葛守跃
 * @version 1.0.0
 * @ClassName DrainPipeNetworkPlanVo
 * @Description TODO
 * @creatTime 2022/11/15 17:55
 */
@Setter
@Getter
@EqualsAndHashCode
public class DrainPipeNetworkPlanExcel implements Serializable {

    /**
     * 项目编号
     */
    @ExcelProperty("项目编号")
    private String cmPlanNo;

    /**
     * 项目名称
     */
    @ExcelProperty("项目名称")
    private String cmPlanName;


    /**
     * 项目周期开始时间
     */
    @ExcelIgnore
    private Date cmPlanStartDate;


    public void setCmPlanStartDate(Date cmPlanStartDate) {
        this.cmPlanStartDate = cmPlanStartDate;
        if(Objects.nonNull(cmPlanStartDate)){
            this.cmPlanStartDateDesc = DateUtil.dateToDateString(cmPlanStartDate, "yyyy-MM-dd");
        }
    }

    /**
     *项目周期开始时间
     */
    @ExcelProperty("项目周期开始时间")
    private String cmPlanStartDateDesc;


    /**
     * 项目周期结束时间
     */
    @ExcelIgnore
    private Date cmPlanEndDate;

    public void setCmPlanEndDate(Date cmPlanEndDate) {
        this.cmPlanEndDate = cmPlanEndDate;
        if(Objects.nonNull(cmPlanEndDate)){
            this.cmPlanEndDateDesc = DateUtil.dateToDateString(cmPlanEndDate, "yyyy-MM-dd");
        }
    }


    /**
     * 项目周期结束时间
     */
    @ExcelProperty("项目周期结束时间")
    private String cmPlanEndDateDesc;


    /**
     * 管网类型
     */
    @ExcelProperty("管网类型")
    private String cmPlanPipeType;

    /**
     * 检测范围描述
     */
    @ExcelProperty("检测范围描述")
    private String cmPlanRangeDescription;

    public void setCmPlanAuditStatus(Integer cmPlanAuditStatus) {
        this.cmPlanAuditStatus = cmPlanAuditStatus;
        if (cmPlanAuditStatus == null || cmPlanAuditStatus == 0){
            this.cmPlanAuditStatusDesc = "待审核";
        }
        if (cmPlanAuditStatus != null && cmPlanAuditStatus == 1){
            this.cmPlanAuditStatusDesc = "审核通过";
        }
        if (cmPlanAuditStatus != null && cmPlanAuditStatus == 2){
            this.cmPlanAuditStatusDesc = "审核不通过";
        }
    }

    /**
     * 审核状态
     */
    @ExcelIgnore
    private Integer cmPlanAuditStatus;


    @ExcelProperty("审核状态")
    private String cmPlanAuditStatusDesc;

    public void setCmPlanDistributionStatus(Integer cmPlanDistributionStatus) {
        this.cmPlanDistributionStatus = cmPlanDistributionStatus;
        if (cmPlanDistributionStatus == null || cmPlanDistributionStatus == 0){
            this.cmPlanDistributionStatusDesc = "未派发";
        }
        if (cmPlanDistributionStatus != null && cmPlanDistributionStatus == 1){
            this.cmPlanDistributionStatusDesc = "已派发";
        }

    }

    /**
     * 派发状态
     */
    @ExcelIgnore
    private Integer cmPlanDistributionStatus;



    @ExcelProperty("派发状态")
    private String cmPlanDistributionStatusDesc;

    public void setCmPlanFinishStatus(Integer cmPlanFinishStatus) {
        this.cmPlanFinishStatus = cmPlanFinishStatus;
        if (cmPlanFinishStatus == null || cmPlanFinishStatus == 0){
            this.cmPlanFinishStatusDesc = "待完成";
        }
        if (cmPlanFinishStatus != null && cmPlanFinishStatus == 1){
            this.cmPlanFinishStatusDesc = "进行中";
        }
        if (cmPlanFinishStatus != null && cmPlanFinishStatus == 2){
            this.cmPlanFinishStatusDesc = "已完成";
        }
    }

    /**
     * 完成状态
     */
    @ExcelIgnore
    private Integer cmPlanFinishStatus;



    /**
     * 完成状态
     */
    @ExcelProperty("完成状态")
    private String cmPlanFinishStatusDesc;
}
